// -----------------------------
// Author: 		Dhaenens Gert 
// Creation: 	2/16/2015 8:05:31 PM				
// -----------------------------

#ifndef _CGraphicsDevice_h
#define _CGraphicsDevice_h

#include "IGraphicsDevice.h"
#include "DxIncludes.h"

namespace Flow
{

	class CGraphicsDevice : public IGraphicsDevice
	{
	public:
		CGraphicsDevice();
		virtual ~CGraphicsDevice();

		virtual void	Release();

		virtual Bool	Initialize(IWindow* lpWindow);
		virtual Bool	InitializeView(IWindow* lpWindow);

		virtual void	Begin(Float r, Float g, Float b) const;
		virtual void	End() const;

		ComPtr<ID3D11Device1>			GetDevice()			{ return m_Device; }
		ComPtr<ID3D11DeviceContext1>	GetContext()		{ return m_DeviceContext; }

	private:

		ComPtr<ID3D11Device1>			m_Device;
		ComPtr<ID3D11DeviceContext1>	m_DeviceContext;
		ComPtr<IDXGISwapChain1>			m_SwapChain;

		ComPtr<ID3D11RenderTargetView>	m_BackBufferView;
		ComPtr<ID3D11Texture2D>			m_DepthStencil;
		ComPtr<ID3D11DepthStencilView>	m_DepthStencilView;

		CGraphicsDevice(const CGraphicsDevice& refCGraphicsDevice);
		CGraphicsDevice& operator=(const CGraphicsDevice& refCGraphicsDevice);
	};

}

#include "ExportMacro.h"
EXPORT_IMPLEMENTATION(GraphicsDevice);

#endif